package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.GoodsSale;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.GoodsSaleManager;

public class GoodsSaleManagerImpl extends AbstractManager implements GoodsSaleManager {

	@Override
	public void addGoodsSale(GoodsSale goodsSale) {

		getHibernateTemplate().save(goodsSale);
	}

	@Override
	public void delGoodsSaleById(String id) {

		getHibernateTemplate().delete(findGoodsSaleById(id));
	}

	@Override
	public PagerModel findAllGoodsSale() {

		return searchPaginate("select gs from GoodsSale gs");
	}

	@Override
	public GoodsSale findGoodsSaleById(String id) {

		return (GoodsSale)getHibernateTemplate().load(GoodsSale.class, id);
	}

	@Override
	public void updateGoodsSale(GoodsSale goodsSale) {

		getHibernateTemplate().update(goodsSale);
	}

}
